/**
 * 
 */
package sailing.entity;

import java.util.Collections;
import java.util.List;

import cjlite.utils.Lists;

/**
 * @author kevin
 * 
 */
public class SubjectCategory {
	private static List<SubjectCategory> scList = Lists.newArrayList();

	private static final SubjectCategory Assets = new SubjectCategory(1000, "资产类");
	private static final SubjectCategory Liabilities = new SubjectCategory(2000, "负债类");
	private static final SubjectCategory Common = new SubjectCategory(3000, "共同类");
	private static final SubjectCategory OwnerEquity = new SubjectCategory(4000, "所有者权益类");
	private static final SubjectCategory Cost = new SubjectCategory(5000, "成本类");
	private static final SubjectCategory GainOrLoss = new SubjectCategory(6000, "损益类");

	private int code;
	private String name;

	public SubjectCategory(int code, String name) {
		this.code = code;
		this.name = name;
		scList.add(this);
	}

	/**
	 * @return the code
	 */
	public int getCode() {
		return code;
	}

	/**
	 * @param code
	 *            the code to set
	 */
	public void setCode(int code) {
		this.code = code;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	public static List<SubjectCategory> getSubjectCateList() {
		return Collections.unmodifiableList(scList);
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		//builder.append("SubjectCategory [code=");
		builder.append(code);
		//builder.append(", name=");
		builder.append(" - ");
		builder.append(name);
		//builder.append("]");
		return builder.toString();
	}

	

}
